<template>
    <view>
        <custom><template #backText>{{seller_type_name}}缴年费</template></custom>
        <nFormItem key="form_seller_info_annual_fee_end_date" v-if="pay.form.seller_type=='0'" title="到期日期" :value="$store.state.user.identity_info.seller_info.annual_fee_end_date==0?'未缴':$store.state.user.identity_info.seller_info.annual_fee_end_date">
        </nFormItem>
        <nFormItem key="form_seller_info_annual_fee_end_date_firm" v-if="pay.form.seller_type=='1'" title="到期日期" :value="$store.state.user.identity_info.seller_info.annual_fee_end_date_firm==0?'未缴':$store.state.user.identity_info.seller_info.annual_fee_end_date_firm">
        </nFormItem>
        <nFormItem key="form_annual_fee_price" title="年费价格" :value="annual_fee_price"></nFormItem>
        <nFormButton :title="seller_type_name + '缴年费'" :tap="()=>{pay.show=true}"></nFormButton>
        <nBar title="商户入驻后缴纳年费标准和权益"></nBar>
        <nDesc class_bottom="margin-top-0">
            <template #bottom>
                一、首年每户0.01元，用于服务器费用。<br>
                二、缴纳后的几项权益：<br>
                1、可以上传产品图片，做店内产品促销活动宣传。<br>
                2、可在线上下单，下单后可到店自取、可同城配送。
            </template>
        </nDesc>
        <pay :pay.sync="pay"></pay>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                seller_type_name: '',
                annual_fee_price: '',
                pay: {
                    formtag: {},
                    form: {},
                    formbak: {},
                    tip_content: '确定要缴年费吗？',
                    pay_uri: '/user/pay/sellerAnnualFee',
                    show: false,
                    load_info: {},
                },
            }
        },
        onLoad(params) {
            if (!params.seller_type) {
                this.$store.commit('appBackPage');
                return;
            }
            this.pay.load_info = params;
            this.pay.form.seller_type = this.pay.formbak.seller_type = params.seller_type;
            this.seller_type_name = this.$dict.get('seller_type_name', this.pay.form.seller_type);
            this.$api.config(this, this.seller_type_name + '.年费', (config) => {
                this.annual_fee_price = config[this.seller_type_name + '.年费'].value;
            })
        },
    }
</script>
